#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import dbus
import dbus.service
from dbus.mainloop.glib import DBusGMainLoop
from time import sleep
 
class BluezBlockService(dbus.service.Object):
    def __init__(self):
        bus_name = dbus.service.BusName('org.bluez', bus=dbus.SystemBus())
        dbus.service.Object.__init__(self, bus_name, '/org/bluez')

DBusGMainLoop(set_as_default=True)
dbus_blocker = BluezBlockService()

if os.path.exists("/tmp/.sixad-dbus-blocker.pid"):
  os.remove("/tmp/.sixad-dbus-blocker.pid")

os.mknod("/tmp/.sixad-dbus-blocker.pid")

while True:
  if os.path.exists("/tmp/.sixad-dbus-blocker.pid"):
    sleep(1)
  else:
    break

